const db = require("../config/mysql_util");
class UsersModel {
    constructor() {}
    findById(id) {
        return db.query("select * from users where id = ?", [id]);
    }
    findByUsername(username) {
        return db.query("select * from users where username = ?", [username]);
    }
    login(data) {
        return db.query("select * from users where username = ? and password= ?", [data.username, data.password]);
    }
    reg(data) {
        return db.query("insert into users set ?", [data]);
    }
}

module.exports = new UsersModel();